﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.Unity.InterceptionExtension;

namespace ParallelCacheHandler
{
    public class CacheKeyException : System.Exception
    {
        private const string _message = @"This method cannot be included for caching because one or more of its 
arguments' type cannot be used for cache key construction. Either exclude this method from caching or implement the IEquatable interface on the argument's type. Make sure the GetHashCode is implemented correctly.";

        public IMethodInvocation Input { get; private set; }
        public object Argument { get; private set; }

        public CacheKeyException(IMethodInvocation input, object argument) : base(_message)
        {
            Input = input;
            Argument = argument;
        }
    }
}
